import request from '@/utils/request'

export function getDocumentRevisionPage(params) {
  return request({
    url: '/api/document-revision/page',
    method: 'get',
    params
  })
}

export function getDocumentRevisionDetail(id) {
  return request({
    url: `/api/document-revision/${id}`,
    method: 'get'
  })
}

export function saveDocumentRevision(data) {
  // 确保日期格式正确
  if (data.applyDate) {
    data.applyDate = new Date(data.applyDate).toISOString().substr(0,10);
  }
  
  return request({
    url: '/api/document-revision/save',
    method: 'post',
    data
  })
}

export function deleteDocumentRevision(id) {
  return request({
    url: `/api/document-revision/${id}`,
    method: 'delete'
  })
} 